PS3Eye Camera SDK for use in your own applications!!!
Many of you asked me how can you use this camera in your applications.
Besides the existing implementation of PS3Eye DirectShow filter, I developed the PS3EyeLib as well.
This SDK library lets you get full access to the PS3Eye camera and allows you to configure the camera and grab video frames.
Lets look at the PS3EyeLib API:
typedef enum
{
R320x240,
R640x480,
}PS3EYE_RESOLUTION;
typedef struct tFormat
{
PS3EYE_RESOLUTION res;
int width;
int height;
DWORD rate;
LONGLONG period;
char formatTxt[32];
}PS3EYE_FORMAT;
class PS3EYELIB_EXPORT IPS3EyeLib
{
public:
static IPS3EyeLib *Create();
virtual ~IPS3EyeLib();
virtual void SetFormat(int formatIdx) = 0;
static PS3EYE_FORMAT *GetFormats();
static int GetNumFormats();
virtual void StartCapture() = 0;
bool GetFrame(PBYTE buf, int bitsPerPixel, bool flip);
virtual void StopCapture() = 0;
virtual void DumpEEPROM(LPCTSTR filename) = 0;
virtual void DumpRAM(LPCTSTR filename) = 0;
virtual void LED(bool on) = 0;
virtual bool IsCapturing() = 0;
virtual UINT GetWidth() = 0;
virtual UINT GetHeight() = 0;
virtual PS3EYE_RESOLUTION GetRes() = 0;
virtual DWORD GetRate() = 0;
static int GetFormatIndex(int width, int height, LONGLONG period);
static int GetFormatIndex(int width, int height, int rate);
virtual LPCTSTR GetCameraVersion() = 0;
};
Here is the example of PS3EyeLib usage in you application:
// Create PS3EyeLib object
IPS3EyeLib *pCam=IPS3EyeLib::Create();
// Query supported video formats
for(int i=0; i<IPS3EyeLib::GetNumFormats(); i++)
{
int width, height, rate;
char *description;
width=IPS3EyeLib::GetFormats()[i].width;
height=IPS3EyeLib::GetFormats()[i].height;
rate=IPS3EyeLib::GetFormats()[i].rate;
description=IPS3EyeLib::GetFormats()[i].formatTxt;
// Display available formats ...
}
// Decide on the format to use (Example: 320x240 * 30fps)
// Select this format
pCam->SetFormat(IPS3EyeLib::GetFormatIndex(320,240,30));
// Allocate image buffer (we are going to capture 24bit RGB images)
// The supported color depths are 16, 24 and 32
PBYTE pBuffer=new BYTE[(320*240*24)/8];
// Start capturing
pCam->StartCapture();
// Process frames until 'done'
bool done=false;
while(!done)
{
// This function will block until a new frame is available
// It will then fill the buffer with frame image data
if(pCam->GetFrame(pBuffer, 24, false))
{
// Process/display video frame here
// ...
// If your program is done set 'done=true;'
}
}
// Free the image buffer
delete [] pBuffer;
// Stop capturing
pCam->StopCapture();
// Free the
delete pCam;
The latest setup file (PS3EyeSetup.2.0b81021), besides the PS3Eye driver, DirectShow filter and test app, includes the following files in the SDK directory:
- IPS3EyeLib.h – Camera API include file
- PS3EyeLib.lib – Camera API library file
- PS3EyeLib.dll – Camera API dynamic library file
List of fixes/additions in the current release:
– Created DirectShow camera property page (selectable resolution and frame rate)
– Support for RGB-16/24/32 color output format
– Implemented both 32-bit and 64-bit versions of the PS3Eye driver
– Fixed the PS3EyeCamera.inf file so that drivers (32-bit and 64-bit) install correctly
– Improved capture performance and responsiveness on Vista OS
If you find the software useful or if you feel like supporting this project, please feel free to click the donation link below.
And of course, the files: PS3EyeSetup (v2.0b81021) and PS3Eye TouchLib (rev400) build.
Enjoy!
[…] PS3Eye Camera SDK for use in your own applications!!! […]
Sony PS3Eye Camera DirectShow Capture Source Filter « Alex Popovich’s Weblog said this on October 20, 2008 at 1:01 am |
YO IM LIKE SO LOST WITH THIS WHOLE THING CAN YOU PLEASE HELP ME!
MIKE said this on October 21, 2008 at 6:17 am |
this is great man but i have a little problem i try to test out my PS3 eye with both test app and am CAP but all i see is a black screen is there any way you can help me figure out what the problem is.
great work man
chris said this on October 22, 2008 at 6:13 am |
Im having the same problem man…any solutions?
Kori said this on June 27, 2009 at 1:11 pm |
i got the same problem a black screen, can someone help me?
Sergio said this on July 11, 2009 at 7:00 am |
where can i find the download link for the latest setup file?
Jake said this on October 22, 2008 at 6:26 am |
[…] PS3Eye Camera SDK for use in your own applications!!! « Alex Popovich’s Weblogより, PS3用のwebカメラPlayStation EyeをDirectShowでキャプチャを行うためのライブラリが 公開されたようです. AlexPさん,ありがとう.これで先走って買ってしまったPlayStation Eyeも自作アプリで活用できます!! ということで早速配布されているSDKを利用し,OpenCVと組み合わせたサンプルを紹介します. #間違い等ありましたら,ご指摘ありましたらよろしくお願いします. (気が向いたら)wikiの方に利用方法を書くかもしれません. ※注意 下記コードは自己責任で利用ください. PLAIN TEXTC++: //———————————————————————- […]
dandelion's log » PS3EyeLibで遊んでみた said this on October 22, 2008 at 11:24 am |
i still can’t get my PS eye to work on amcap, could someone please help!!!!!
Jake said this on October 23, 2008 at 2:22 am |
hi, umm im new to this but i did get my camera to work on my pc “vista” and these new updates,.. well i dont know what to do with them, can you explain where and how to install them, thanks,
mike.
mike said this on October 24, 2008 at 3:22 am |
Hi Alex, firstly, THANK YOU for writing this awesome code that everyone has been waiting for.
My question is to ask you if you have any intention of implementing the IAMStreamConfig interface for the PS3Eye DirectShow filter? This interface is usually used to control camera format / frame-rate. I think placing your format controls on the camera property page is the wrong place to do this (I believe this is because the format is not supposed to be able to changed while the filter is connected and running and the camera property page should only expose controls that CAN be altered whilst running, like exposure etc).
Currently my application is designed to work with webcams but doesn’t work with your DirectShow driver as my code can’t get or set the video formats.
I could wrap your nice and simple PS3EyeLib stuff, but that would be quite a bit of work and special provision – much nicer if your DirectShow driver can be made to conform to the standard.
Kind Regards,
Tim
Tim Edwards said this on October 24, 2008 at 6:17 am |
Tim, thanks for your comment. I am looking into adding some camera controls to the property page. You are absolutely right. The resolution and framerate combobox I had there was just for testing that I forgot to remove. I do have IAMStreamConfig implemented in my filter class. The new filter operates in ‘push’ mode and the new release is coming soon.
Alexander Popovich said this on October 25, 2008 at 6:01 am |
hi there thanks for the software i’m a bit new to this will the cam work on msn now i can get mine to find it ?
paul said this on October 26, 2008 at 1:45 pm |
PS3EyeSetup.2.0b81021.exe is not installing for me on XP 64. Everything appears to install correctly on the first pass of the found hardware wizard, but on the second pass, I get the message unable to install, compatable driver not found. Make sure device is compatagle with 64-bit systems (paraphrased).
WHen I try to run PS3EyeTest anyway, I get the message
winusb.dll not found, though it is in C:\WINDOWS\system32
Thanks for your attention – will work for fix.
Denis Fitzpatrick said this on October 26, 2008 at 8:17 pm |
im having the same problem and no 1 helps on this website for me.
anthony said this on August 20, 2009 at 2:54 pm |
Does the playstation eye driver you created make it possible to use it for programs such as skype?
Richie said this on October 27, 2008 at 8:54 am |
I was wondering if the eye works with skype
chris said this on October 27, 2008 at 8:51 pm |
A tutorial of some sort on how to get this working with MSN and with Adobe Flash Media Encoder would be GREATLY appreciated. I can run the PS3Eye Test App (which works great), but thats it. Maybe I did something wrong installing.. If I run AMCAP it tells me “Cannot render video capture stream”.
Kris said this on October 28, 2008 at 5:40 am |
Hello Alex
I am using this software very happily.
But..Software confirms the error that stops suddenly many times.
Please improve it.
I am expecting it of this software and your possibility.
Thank you.
rick said this on October 31, 2008 at 2:28 pm |
Please recognize it as web camera. lol
mst said this on October 31, 2008 at 6:18 pm |
Hi, Alex, thank you for your efforts to hack PS3 Eye. I am developing an application to use PS3 Eye. Initially I tried to use cvcam library to use PS3 Eye with your solid driver, but I failed. So I decided to use your SDK in my application. My current problem is “protection error” occurs during execution of my application. Before applying your SDK, my application worked well except accessing PS3 Eye. Path and linking are all right and there is no error during compilation. After linking your library, it shows protection error and doesn’t show the basic window at all. I think creating PS3EyeLib object causes the error in my application. I use MFC on Visual Studio 2008. Please give me any advice!!!
Best Regards,
James
James said this on November 2, 2008 at 2:33 am |
James, are you running it in debug mode? Try release mode. My PS3EyeTest app is MFC app as well. I used VS2005 to compile mine, but that should not be an issue.
Alexander Popovich said this on November 2, 2008 at 1:02 pm |
I tried release mode and it caused the same error. Finally I found that debuger makes that error and by setting the debugger to “managed only” in even release mode, I could run it. Maybe different OS caused this? (I use XP and you use Vista) Acutually through cvcam library my app also works well to use PS3 Eye. Instead I can select only row frame rates you specified. To use high frame rate at least 60f, I still need to use your SDK. I have another question. pCam->StartCapture() this function is very simple, but unlikely cvcam library it doesn’t take any window handle as an argument. How can I display the video stream on my specific window after pCam->StartCapture() starts? I think some setting is required before pCam->StartCapture(). Could you give me a hint?
Thanks.
James
James said this on November 2, 2008 at 2:28 pm |
i can’t get my ps3 cam to work. i installed the software, i do a test and no pictur. what am i doing wrong?
alvaro said this on November 8, 2008 at 1:46 am |
hey is there any way i can get it to work on stickam.com?
by the way thanks for making this software im greatly appreciative
Daniel said this on November 8, 2008 at 6:11 pm |
So does the pseye work with skype now or what? this site has died down with no new updates.
TacoJones said this on November 11, 2008 at 7:55 pm |
what did u use to show the frames of the ps3eye in a window?
did u use a specific graphic library (i.e : Qt)or the usual winMain …? if you used winmain can you specify whether you used capDriverConnect?
thanks.
antoine said this on November 13, 2008 at 11:24 am |
Hi Alexander, I’m trying to install the PS3Eye on my computer but it’s not working. The install program say that it was intalled ok but when I open PS3Eye Test App it says that winusb.dll was not found. I alredy uninstall, re-install, reboot and still not working.
I´m using PS3EyeSetup.2.0b81021.exe (is that the last?) and WinXP 64-bit.
Sorry my bad English
Thanks
Dan
Dan said this on November 20, 2008 at 6:17 am |
Great job!
Thanks so muchfor giving this to the community. VERY appreciated.
Only problem is that your app seems to hang from time to time on my Centrino notebook. It seems related to bandwidth: if i go for hi-res hi-refreshrate (640×480@60) it works for a few seconds then it stops forking. It seems related to some kind of overflow of the USB bus, I’m able to make itworse if I force some sudden change in the image (like covering the lens and then removing the hand).
Are you sure you are trapping all the possible overflows of the link?
You’re great,
Franco
Franco said this on December 1, 2008 at 3:34 am |
Is it possible to have a video stream with cam over MSN? I trief but MSN didnt locate my Camera in the Options.
Johncena09 said this on December 7, 2008 at 11:42 am |
Hi Alex,
I’m working to get macam (an open source mac OS X webcam driver package) to support the manual features of the PS3 EYE. In particular, I’m looking for information about the registers you access to control exposure, gain, and white balance. Could you point me in the right direction (either as a reply or via email)? I realize you have not open-sourced your work, but it would be great if you could provide some input to get other cam drivers (especially those not running on windows) up to speed.
Thanks!
Adam
kumpf@mit.edu
Adam Kumpf said this on January 2, 2009 at 5:03 pm |
well,it odviosly can be accesed on a pc it comes through on the test, but I cant get it to work on anything else,not on skype or messanger 😦
ScytheDremora said this on January 2, 2009 at 11:29 pm |
Why is the PS3Eye driver time-bombed? It no longer works and keeps putting up a dialog titled, “Unregistered Version” asking me to get an updated version. I’m using the most recent file on your site. What gives?
SaintWaldo said this on January 6, 2009 at 3:51 pm |
Sorry Alex, I was grabbing wrong version from the non-central page. For those looking, the most recent version is always here: https://alexpopovich.wordpress.com/2008/10/02/sony-ps3eye-camera-directshow-capture-source-filter/
SaintWaldo said this on January 6, 2009 at 4:22 pm |
This is so gay… before the stupid lib sent me countless errors for update, my cam worked on MSN, now it doesnt, way to go -_-
oscar said this on January 7, 2009 at 9:49 pm |
why isnt it possible to capture 120 fps at directshow?
realtime said this on January 9, 2009 at 1:06 pm |
I’m trying to use cam with yahoo and it starts but however i invite just see a black window……can I get some help on this pls……I do appreciate your work greatly….
Kareem said this on January 10, 2009 at 3:07 pm |
every time i want to start the PS EyE test app it says it cant find winusb.dll
Luk said this on January 24, 2009 at 7:43 am |
Hi Alex.
Your technique is great, that’s why I’m very sad
The reason is, “Alex device” is not recognized as a multi-camera
I have two cameras
And I was testing a camera
The result is・・
“Alex device” by other software
He is recognized as one device,
2 recognizes that there were no cameras.
2 can be used as a device with multiple cameras・・
Dear Alex,
Please grant me my wish
Thanks
mami said this on January 31, 2009 at 6:59 am |
I have tried the “ps3eyesetup” just now. It is great! Thanks a lot.It works property on one PS3EYE cameras. However, I want to use two cameras at the same time. It seems that your library does not support multi cameras capturing at the same time. I have installed all drivers in my system without any errors. There are two “PS3eye camera (X32)” and two “USB audio device” in the hardware management list. When I plug two ps3eye cameras in my pc. There is only one camera can be found in AMCAP when I click “Devices”. I have test that both cameras can work well seperately with differnet USB port. This also happen in “PS3Eye test” program. So can you take a look of this problem. Thanks.
Hayes said this on February 3, 2009 at 6:53 pm |
hi alex
this is a GOD(good)works!!!
but..I need multi cam s..
I tested with a multiple camera
but it is in other applications has been recognized as a single device.
oh my god
dear alex.
Please solve this problem
thx
gonown said this on February 4, 2009 at 8:39 pm |
I am working right now on the multi-camera version of my driver. I have some very exciting results. Please be patient. I’ll post the new version of driver as soon as I finish all the testing.
Alexander Popovich said this on February 25, 2009 at 1:23 pm |
When I am running Visual Studio Debugger, a “protection error” shows up. Any thought? In addition, how can I achieve 150 FPS with the SDK?
lakeeast said this on February 4, 2009 at 10:33 pm |
The max frame rate of the cam is 125fps @ 320×240 resolution. This limitation is not due to software but due to the hardware sensor.
Alexander Popovich said this on February 25, 2009 at 1:21 pm |
plzz multi cam driver
at not found other application
Dl
http://shoot3d.biz/recorder/download/publish.htm
ginias said this on February 12, 2009 at 9:28 am |
can you help me please i am getting same error message winusb.dll
kelly richardson said this on February 12, 2009 at 10:28 am |
Dude, love your work. Is it possible to hook up 2 cameras to one computer? I’m wanting to do some stuff with stereo. If not, is it because of software or USB bandwidth limits?
Steve said this on February 25, 2009 at 2:07 am |
I love your site!
_____________________
Experiencing a slow PC recently? Fix it now!
Michael Tim said this on February 28, 2009 at 9:26 am |
aclara lo k pones k se lee un pijo!
su pua madre said this on March 7, 2009 at 2:15 pm |
clear up all this fucking shit stuff!!! doesit look like we uderstnd
su pua madre said this on March 7, 2009 at 2:16 pm |
yeaaaaa:b
Im very very excited about
your well!!
enic said this on March 11, 2009 at 5:50 pm |
Is it still not possible to use multiple cam ?
I have a project with at least 4 PS3EYE, but I am not able to make tem all work in the same time…
ZeblodS said this on March 12, 2009 at 4:56 am |
Hi Alex,
Thank you for your job. I would like to add this camera to my setup but I have a problem with a simple graphedit test. The graph I build with your directshow capture filter stop automatically after a few seconds. Do you have some explanation for this behaviour?
Thx
thiv said this on March 13, 2009 at 10:14 am |
Hi Alex,
First of all, kudos for all the effort you are putting into this project.
I am currently working on a project where low cost/fast cam is needed. We´re developing it on .Net 3.5/C#. I´ve noticed that your API is coded in C++, would it make sense to create a managed C# wrapper? Would the route go via DllImports/PInvokes?
Your comments would be much appreciated,
Thanks,
Martin
Martin Tall said this on March 18, 2009 at 6:21 am |
http://www.codelaboratories.com/files/PS3Eye%20Camera%20Setup%20v2.1.0.0130.exe gives “Page Load Error – The connection to the server was reset while the page was loading.” Do you have the file hosted elsewhere? A mirror site perhaps?
James said this on March 19, 2009 at 11:56 pm |
hi alex.your lerease multiCams program im so happy
hhh said this on March 27, 2009 at 9:54 am |
[…] Notes (v2.0b81019): Created DirectShow camera property page (selectable resolution and frame rate). Support for RGB-16/24/32 color output format. Implemented both 32-bit and 64-bit version of the PS3Eye driver. Fixed the PS3EyeCamera.inf file so that drivers install correctly. Included PS3EyeLib SDK as described here. […]
Sony PS3Eye Camera DirectShow Capture Source Filter *Update* v2.1.0.0130 - AlexP’s Blog said this on March 30, 2009 at 11:07 am |
Hey alex i just wanna say thank you for your amazing effort in making this possible and writing such wonderful stuff man.
Well i just wanna know is it possible for me to use PS3 eye to capture direct videos you know like if i wanna make Vlogs and stuff can i use it? I dont really understand what the Lib is all about. And also i installed something called directshow and whenever i tried using it my screen gives me BSOD previously i think its coz of the eye. Mind helping me out bro thanks alot m8. Peace. Ouh do refer to my site if you need a new website we could make an awesome one for you m8.
Kamal said this on April 10, 2009 at 5:42 am |
i have a custion, in skype, the micro is no enable?
i have windows vista,
please make a manual,
nice job
dan said this on May 4, 2009 at 6:53 pm |
Hi, excelent job! It’s an extremely useful library.
I’d like to ask you what type of data should the fourth byte in the 32 bit capture mean ? I’m trying that capture format and all i get in the fourth channel is black…
Thanks a lot!
Keep the good job!
galleta said this on May 13, 2009 at 10:29 am |
We are doing multiple video camera array research. Hope that your multi-camera version will be available soon
Edward Yau said this on June 1, 2009 at 12:15 am |
Has anyone got this working on XP64 bit? So far it looks like a no go. Thanks for all the effort thus far though. TIA.
dEATHm3RCHANT said this on June 3, 2009 at 12:40 pm |
Dear Alex,
first of all many thanks for getting this working and sharing this
with the community. We are academics developing a motion tracking app
for use in biomedical research – being able to use the ps3 camera as high-frame rate capture device means that we can hopefully put together an ultra-low cost analysis system that could be used in developing countries. Your driver with the ps3 cam effectively cut the system cost by 80% – way to go!
Here my question: We are using Matlab on 64 bit systems to develop the vision algorithms and would like to directly capture the data from your SDK. Could you supply the PS3EyeLib SDK compiled as 64 bit lib
(“module machine type ‘X86’ conflicts with target machine type ‘x64′”)?
It would be much appreciated,
Thanks!
Aldo
Dr Aldo Faisal said this on July 4, 2009 at 4:21 pm |
PS: our system is of course open-source, open-hardware!
Dr Aldo Faisal said this on July 4, 2009 at 4:25 pm |
Hey Alex, great work on the SDK and the driver, and thanks for sharing 🙂
I was wondering if its possible to get the buffer in another color space then RGB (or BGR) from your sdk? I need a YUV image, which i think is the PSEye color format originally. Converting RGB to YUV(or YCrCb) is pretty slow as it requires floating point math, i even tried using sse intrinsic and it got even slower :S
Gab said this on August 6, 2009 at 6:23 pm |
Hi Alex
Thanks for sharing your work with the community. I would like to ask if you also can provide the SDK for 64 bit systems, as the current one only works for x86 systems. Thanks a lot!
A.P.
A.P. said this on August 17, 2009 at 2:44 am |
Hi Alex!
Your work is simply incredible
THX A LOT
Phil said this on October 1, 2009 at 10:15 pm |
I Downloaded It Right But When I Check My Device Manager I Don’t See ps3eye video componet
Khadijah said this on November 23, 2009 at 7:39 pm |
Hi,
I’m a media arts student working on a project with OpenCV and python, and using your wonderful drivers for the camera. Has anyone made python wrappers for the ps3eye API? I’m far too much a beginner to know how to do that. Just so I can control the exposure, framerate, etc – right now it adjusts automatically which really messes up my program!
Thanks for any help,
Peter
Peter said this on December 4, 2009 at 3:19 pm |
It’s great using your software and really appreciate your efforts. I can really enjoy my cam now. kudos
Stephen said this on May 25, 2011 at 12:50 am |